package com.spring.mybatis.demo.controller;

import java.util.List;

import com.spring.mybatis.demo.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.spring.mybatis.demo.Model.Student;
import com.spring.mybatis.demo.Model.User;
import com.spring.mybatis.demo.service.StudentService;
import com.spring.mybatis.demo.service.UserService;

/**
 * com.spring.mybatis.demo.controller
 *
 * @author humdeef
 * @since 2019-07-14
 */
@RestController
public class UserController {

  @Autowired
  private UserService userService;

  @Autowired
  private StudentService studentService;

  @RequestMapping("/user/list")
  public List<User> queryUserAll() {
    return userService.queryAll();
  }

  @RequestMapping("/student/list")
  public List<Student> queryStudentAll() {
    return studentService.queryAll();
  }
}
